//package sicnu.cs.ich.ich.ranking.mq;
//
//import com.alibaba.fastjson.JSON;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
//import org.apache.rocketmq.common.message.MessageExt;
//import org.springframework.stereotype.Component;
//import sicnu.cs.ich.ich.ranking.service.IActivityRankingService;
//import sicnu.cs.ich.rocketmq.rocketmq.AbstractRocketConsumer;
//
///**
// * @author 黎琦
// * @date 2021/12/23 15:07
// **/
//@Slf4j
//@Component
//@RequiredArgsConstructor
//public class ActivityRankingConsumer extends AbstractRocketConsumer {
//    private final IActivityRankingService activityRankingService;
//
//    @Override
//    public void init() {
//        super.necessary("activity", "*", "活动排行榜消费");
//        handleMessage();
//    }
//
//    public ConsumeConcurrentlyStatus activity(MessageExt message){
//        final var activityId = (Integer) JSON.parse(message.getBody());
//        activityRankingService.activityHitIncrement(activityId);
//        return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
//    }
//
//    public ConsumeConcurrentlyStatus call(MessageExt message){
//        final var activityId = (Integer) JSON.parse(message.getBody());
//        activityRankingService.activityHitIncrement(activityId);
//        return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
//    }
//}
